package com.augn.controller;

import com.augn.entity.Cooperations;
import com.augn.entity.Result;
import com.augn.service.ICooperationsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/cooperations")
public class CooperationsController {

    @Autowired
    private ICooperationsService service;

    @PostMapping("/insertOne")
    public Result<?> insertOneCooperations(@RequestBody Cooperations cooperations) {
        return service.insertOneCooperations(cooperations);
    }

    @DeleteMapping("/deleteOne/{id}")
    public Result<?> deleteOneCooperations(@PathVariable Integer id) {
        return service.deleteOneCooperations(id);
    }

    @GetMapping("/getOne/{id}")
    public Result<?> getOneCooperations(@PathVariable Integer id) {
        return service.getOneCooperations(id);
    }
    
    @GetMapping("/getPart/{id}")
    public Result<?> getPartCooperations(@PathVariable Integer id) {
        return service.getPartCooperations(id);
    }
}
